<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 微信客服
 */
class CreateWechatCustomer extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_customer', function (Blueprint $table) {
            $table->increments('id');
            $table->string('account')->comment('完整客服帐号');
            $table->string('nickname')->comment('客服昵称');
            $table->string('headimgurl')->comment('客服头像');
            $table->string('wechatNo')->nullable()->comment('绑定的微信号');
            $table->string('inviteWechatNo')->nullable()->comment('邀请绑定的微信号');
            $table->timestamp('inviteExpireTime')->nullable()->comment('邀请的过期时间');
            $table->tinyInteger('inviteStatus')->default(-1)->comment('邀请状态 -1=尚未邀请 0=已通过 1=等待确认 2=被拒绝 3=过期');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('wechat_customer');
    }
}
